package com.bjpowernode.controller;

import com.bjpowernode.query.TranHistoryQuery;
import com.bjpowernode.query.TranQuery;
import com.bjpowernode.result.Result;
import com.bjpowernode.service.TranHistoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class TranHistoryController {

    private final TranHistoryService tranHistoryService;

    @PostMapping("api/tran/stage")
    public Result tranStage(@RequestBody TranHistoryQuery tranHistoryQuery) {
        boolean flag = tranHistoryService.saveTranStage(tranHistoryQuery);
        return flag ? Result.OK(): Result.FAIL();
    }
}
